package com.wbc.smartHome.dao;


import com.wbc.smartHome.model.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserDao {



    @Select("select count(*) from user where account = #{account}")
    int checkAccount(String account);

    @Insert("insert into user(name,account,state,oper_time)values(#{name},#{account},#{state},now())")
    void saveUser(User user);

    @Select("select * from user where account = #{account} ")
    User loginUser(User user);

    @Update("update user set name=#{name},name = #{name} , account = #{account} ,phone=#{phone},gender = #{gender} ,birthday = #{birthday} , address = #{address} where id = #{id}")
    void updateUser(User user);

    @Select("select * from user where id = #{id}")
    User updateReturn(User user);



}
